package com.nisco.dms.entity;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.apache.commons.lang3.builder.ToStringBuilder;

@Entity
@Table(name = "sm_sql_table")
public class SqlTable extends CoreEntity {

	@Column(nullable = false, length = 100)
	private String tabName;

	@Column(length = 200)
	private String tabDes;

	@Column(nullable = false, length = 10)
	private String status;

	@OneToMany(mappedBy = "sqlTable", cascade = CascadeType.ALL)
	private List<SqlColumn> sqlColumns = new ArrayList<SqlColumn>(0);

	public String getTabName() {
		return tabName;
	}

	public void setTabName(String tabName) {
		this.tabName = tabName;
	}

	public String getTabDes() {
		return tabDes;
	}

	public void setTabDes(String tabDes) {
		this.tabDes = tabDes;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public List<SqlColumn> getSqlColumns() {
		return sqlColumns;
	}

	public void setSqlColumns(List<SqlColumn> sqlColumns) {
		this.sqlColumns = sqlColumns;
	}

	/**
	 * reflectionToString将对象输出为string类型。
	 */
	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this);
	}

}
